package com.terrynoya.Resource
{
	import flash.events.EventDispatcher;
	
	[Event(name="complete",type="com.terrynoya.Resource.events.ExternalClassLoaderEvent")]
	
	[Event(name="io_error",type="com.terrynoya.Resource.events.ExternalClassLoaderEvent")]
	
	[Event(name="class_not_found",type="com.terrynoya.Resource.events.ExternalClassLoaderEvent")]
	
	/**
	 * UzExternalClassLoader 类，用于加载外部资源的Linkage
	 * 传入类的完全限定名，当Complete时，就可以从
	 * ApplicationDomain.currentDomain.getDefinition(ld.name)得到这个类的Class
	 * @author yaojianzhou
	 */
	public class ExternalClassLoader extends EventDispatcher
	{
		private var _className:String;
		
		/**
		 * 
		 * @param className
		 */
		public function ExternalClassLoader(className:String)
		{
			this._className = className;
		}
		
		/**
		 * 
		 * @return 
		 */
		public function get name():String
		{
			return this._className;
		}
		
		/**
		 * 
		 */
		public function load():void
		{
			ExternalResManager.instance().loadClass(this);
		}
	}
}